﻿@model IEnumerable<KRM.Core.tblAuditproductOptionPriceHistory>
@{
    ViewBag.Title = "Price History Audit";
    Layout = "~/Views/Shared/_PopupLayout.cshtml";
    var productoptionid = ViewBag.productOptionId;
}
<script>
    $(function() {
        $("#cbTo").change(function() {
            if ($(this).is(":checked")) {
                $("#to").removeAttr("disabled");
            } else {
                $("#to").attr("disabled", "disabled");
            }
        });
        $("#cbFrom").change(function () {
            if ($(this).is(":checked")) {
                $("#from").removeAttr("disabled");
            } else {
                $("#from").attr("disabled", "disabled");
            }
        });
    })
</script>
<div style="padding: 20px;">
    <form action="/orderview/NewOrderPriceHistoryAudit" class="margin0">
        <input type="hidden" name="productoptionid" value="@productoptionid"/>
        <div class="row-fluid">
            <div class="span1">Username</div>
            <div class="span2">
                <input type="text" name="username" class="input-block-level" />
            </div>
            <div class="span1 text-right">Action</div>
            <div class="span1">
                <select name="ac" class="input-block-level">
                    <option value="All">- All -</option>
                    <option value="Delete">Delete</option>
                    <option value="Edit">Edit</option>
                </select>
            </div>
            <div class="span1">Between</div>
            <div class="span2">
                <div class="datetimepicker input-append">
                    <input type="checkbox" id="cbFrom"/>
                    <input data-format="MM/dd/yyyy" type="text" name="from" id="from" style="width: 70%" disabled="disabled">
                    <span class="add-on">
                        <i data-time-icon="icon-time" data-date-icon="icon-calendar" class="icon-calendar"></i>
                    </span>
                </div>
            </div>
            <div class="span2">
                <div class="datetimepicker input-append">
                    <input type="checkbox" id="cbTo"/>
                    <input data-format="MM/dd/yyyy" type="text" name="to" id="to" style="width: 70%" disabled="disabled">
                    <span class="add-on">
                        <i data-time-icon="icon-time" data-date-icon="icon-calendar" class="icon-calendar"></i>
                    </span>
                </div>
            </div>
            <div class="span2">
                <input type="submit" value="Search" class="btn btn-primary" />
                <a href="/orderview/neworderpricehistory?productoptionid=@productoptionid" class="btn btn-success">Back</a>
            </div>
        </div>
    </form>
    <table class="table table-bordered table-fix table-hover">
        <thead>
            <tr>
                <th>ProductName</th>
                <th>ProductOption</th>
                <th>Action</th>
                <th>OldPrice</th>
                <th>Price</th>
                <th>CreationDate</th>
                <th>Username</th>
                <th>POID</th>
            </tr>
        </thead>
        <tbody>
            @foreach (var item in Model)
            {
                <tr>
                    <td>@item.ProductName</td>
                    <td>@item.ProductOption</td>
                    <td>@item.Action</td>
                    <td>@item.OldPrice</td>
                    <td>@item.Price</td>
                    <td>@item.CreationDate</td>
                    <td>@item.UserName</td>
                    <td>@item.ProductOptionID</td>
                </tr>
            }
        </tbody>
    </table>
</div>

